package org.sourcecode.common.exception;

import java.io.Writer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import freemarker.core.Environment;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;

public class FreemarkerExceptionHandler implements TemplateExceptionHandler{

	protected final Log log = LogFactory.getLog(getClass());
	
	public void handleTemplateException(TemplateException te, Environment env,
			Writer out) throws TemplateException {
		
		try {
			out.write("{process template fail}");
		} catch (Exception e) {
			log.warn(e.getMessage());
		}
		
	}

}
